﻿<%@ Page Language="C#" AutoEventWireup="true" Inherits="FL.Web.BackEnd.DataGrid" %>

<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title></title>
    <script src="../../SFramework/boot.js"></script>
    <style type="text/css">
        html, body {
            margin: 0;
            padding: 0;
            border: 0;
            width: 100%;
            height: 100%;
            overflow: hidden;
        }


        body {
            padding-left: 0px;
            font-size: 13px;
        }

        h1 {
            font-size: 20px;
            font-family: Verdana;
        }

        h4 {
            font-size: 16px;
            margin-top: 25px;
            margin-bottom: 10px;
        }

        .description {
            padding-bottom: 30px;
            font-family: Verdana;
        }

            .description h3 {
                color: #CC0000;
                font-size: 16px;
                margin: 0 30px 10px 0px;
                padding: 45px 0 8px;
                /*background:url(titleback.png) no-repeat scroll left bottom transparent*/
                border-bottom: solid 1px #888;
            }

        .col1 {
            float: left;
            width: 25%;
        }

        .col2 {
            float: left;
            width: 50%;
        }

        .query_table {
            width: 100%;
        }

        .label {
            width: 90px;
            text-align: right;
        }

        .exp {
            width: 60px;
        }

            .exp > select {
                width: 60px;
            }
    </style>

    <!--引入皮肤样式-->
    <%--    <link href="../../SFramework/miniui/themes/blue/skin.css" rel="stylesheet" />--%>
</head>

<body>

    <div class="mini-splitter" style="width: 100%; height: 100%;">
        <div size="240" showcollapsebutton="true">
            <div class="mini-toolbar" style="padding: 2px; border-top: 0; border-left: 0; border-right: 0;">
                <% =getItem("left") ==""?GetStringFromQueryString("title","组织结构"):getItem("left") %>
                <!--
                <a class="mini-button" iconcls="icon-add" plain="true" onclick="fnAddMaster()">新增</a>
                <a class="mini-button" iconcls="icon-edit" plain="true" onclick="fnEditMaster()">修改</a>
                <a class="mini-button" iconcls="icon-remove" plain="true" onclick="fnDeleteMaster()">删除</a>
                -->
            </div>
            <div class="mini-fit">
                <ul id="tree1" class="mini-tree" url="../data/jsondata.aspx?nodataright=false&entity=<%=GetStringFromQueryString("masterentity","t_base_department") %>&condition=<% =GetStringFromQueryString("master_condition","") %>&type=1&order=<% =GetStringFromQueryString("master_order","") %>&desc=<% =GetStringFromQueryString("master_desc","No") %>&functionid=<% =this.FunctionID%>" style="width: 100%;"
                    showtreeicon="true" textfield="name" idfield="id" parentfield="parent_id" resultastree="false" expandonload="true">
                </ul>
            </div>
        </div>
        <div showcollapsebutton="true">
            <div class="mini-toolbar" style="padding: 2px; border-top: 0; border-left: 0; border-right: 0;">
                <table style="width: 100%;">
                    <tr>
                        <td style="width: 100%;">
                            <%=getItem("")%><%=getItem("right")%>
                        </td>
                        <td style="white-space: nowrap;"><a class="mini-button" iconcls="icon-expand" plain="true" onclick="showQuery()" id="btnHQuery">查询</a></td>
                        <td style="white-space: nowrap;">
                            <input type="checkbox" id="checkAndOr" /><span style="margin-top: -5px;">并集</span>
                            <input id="QueryContext" type="text" />
                            <%-- <a class="mini-button" onclick="fnQuciklyQuery()">查询</a>--%>
                        </td>
                    </tr>
                </table>
            </div>
            <div id="QueryItem" style="display: none;">
                <table style="width: 100%;">
                    <tr>
                        <td style="width: 100%;">
                            <div><%=QueryHtml %></div>
                        </td>
                    </tr>
                    <tr>
                        <td>
                            <div style="width: 99.9999%; text-align: center; border-top: #808080 1px solid; padding-top: 5px; padding-bottom: 5px; margin: 0px;">
                                <a class="mini-button" iconcls="icon_close" onclick="fnEmptyQuery()">清空</a><a class="mini-button" iconcls="icon_close" onclick="fnCloseQuery()" onkeypress="">关闭</a><a class="mini-button" iconcls="icon_find" onclick="fnHightLevelQuery()">查询</a>
                            </div>
                        </td>
                    </tr>
                </table>
            </div>
            <div class="mini-fit">
                <div id="grid1" class="mini-treegrid" style="width: 100%; height: 100%;" url="../data/jsondata.aspx?entity=<%=EntityName%>&type=1&order=<% =Order %>&desc=<%=Desc%>&customCondition=<%=Condition %>" showtreeicon="true"
            treecolumn="name" idfield="id" parentfield="parent_id" resultastree="false" allowresize="true" expandonload="true">
            <div property="columns">
                <div type="indexcolumn"></div>
                <%=DataFields %>
                </div>
                </div>
            </div>
        </div>
    </div>
    <script type="text/javascript">
        const_entityID = "<% =EntityId %>",    //实体ID名称
        const_entityName = "<% =EntityName %>",//实体名称
        const_EditEntity = "<% =EditEntity %>",//编辑实体名
        const_ViewEntity = "<% =this.GetStringFromQueryString("View_Entity","")%>",//编辑界面对应的数据显示实体
        const_functionId   ="<% =FunctionID %>",//自定义条件
        const_Order ="<% =Order %>",           //排序  
        const_Desc ="<% =Desc %>",           //升降序  
        const_UserId = "<% = UserId %>",       // 
        const_QueryField="<% =QuciklyQueryFields %>",
        const_CustomCondition = encodeURI("<% =DefineCondition %>"),//查询方案条件
        const_TreeCustomCondition = "";
        const_Condition = encodeURI("<% =Condition %>"),//
        const_PageTitle=encodeURI("<% =PageTitle %>"),
        _openWindowHeight=<%=EditWindowHeight%>,
        _openWindowWidth=<%=EditWindowWidth%>;
        <% =ColumnDataSource%>
    </script>
    <script>
        <% =List_self_script %>
    </script>
    <script type="text/javascript">
        mini.parse();

        var tree = mini.get("tree1");
        var grid = mini.get("grid1");

        var treeId = null;
        tree.on("nodeselect", function (e) {
            if(typeof(fnCustomNodeSelect)=="function")
            {
                fnCustomNodeSelect(e);
                return;
            }
            treeId=e.node.id;
            const_TreeCustomCondition = "<%=GetStringFromQueryString("fkey","parent_id")%>='"+e.node.id+"'";
            grid.setUrl("../data/jsondata.aspx?entity=" + const_entityName +  "&order=" + const_Order +"&desc="+const_Desc+"&datagrid=true&pagesize=1000&customCondition=<%=Condition %>&condition="+const_TreeCustomCondition);
            //const_TreeCustomCondition="";
            grid.load({ /*condition:"<%=GetStringFromQueryString("fkey","parent_id")%>='"+e.node.id+"'"*/});
<%--            if (e.isLeaf) {
                grid.setUrl("../data/jsondata.aspx?entity=" + const_entityName +  "&order" + const_Order + "&datagrid=true&pagesize=1000&customCondition=<%=Condition %>");
                grid.load({ condition : "<%=GetStringFromQueryString("fkey","parent_id")%>='"+e.node.id+"'" });
            } else {
                grid.setData([]);
                grid.setTotalCount(0);
            }--%>
        });
    </script>
    <script src="../../Scripts/datagrid/list.common.button.js"></script>
    <script src="../../Scripts/common/jquery.action.js"></script>
    <script src="../../Scripts/common/jquery.data.js"></script>
    <script src="../../scripts/app/list/<%=EntityName %>.list.js?v=0.1"></script>
</body>
</html>
